package com.renjun.smweb.controller.AdmissionController;

import com.alibaba.fastjson.JSONObject;
import com.renjun.smweb.annotation.AuthorityDeclaration;
import com.renjun.smweb.commons.global.DataMap;
import com.renjun.smweb.commons.util.ResponseUtils;
import com.renjun.smweb.dao.pojo.LoginInfo;
import com.renjun.smweb.service.AdmissionService.AdmissionService;
import com.renjun.smweb.annotation.AuthorityDeclaration;
import com.renjun.smweb.commons.global.DataMap;
import com.renjun.smweb.commons.util.ResponseUtils;
import com.renjun.smweb.dao.pojo.LoginInfo;
import com.renjun.smweb.exceptions.DictIsNotFoundException;
import com.renjun.smweb.exceptions.SystemTimeOutException;
import com.renjun.smweb.service.AdmissionService.AdmissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.sql.SQLException;
import java.util.Map;

/**
 * Created by RenJun on 2017/2/21.
 * 录取管理M7
 */
@Controller
@RequestMapping("/admission")
public class AdmissionController {
    @Autowired
    private AdmissionService admissionService;

    /**
     * 报名学生录取列表M7-11
     *
     * @param {limit:10,offset:0,order:"",sort:"",xm,sfzjh,sfzlx,njdm,ryyj,hksf,hkqx,djlx,lqzt,checkstatus,hksfscope,hkqxscope}
     * @return [{id,bmxxmc,njdm,xm,xb,sfzlx,sfzjh,csrq,hksf,hkqx,ryyj,zfxz,djlx,lqzt,checkstatus}]
     * by huamin
     * 0待录取  && setlqzt=1        显示按钮：录取，
     *  0待录取  && setdtczt=1	                设置待统筹
     *   1学校录取  && setlqzt=1  	显示按钮：取消录取
     *  2待统筹	   && setdtczt=1	显示按钮：取消设置待统筹
     *  3区县统筹录取		        显示按钮：不显示
     */
    @RequestMapping(value = "/queryXXDJXSList", method = RequestMethod.POST)
    @ResponseBody
    @AuthorityDeclaration(id = "M7-11", desc = "报名学生录取列表",reqParam = "limit,offset,order,sort,xm,sfzjh,sfzlx,njdm,ryyj,hksf,hkqx,djlx,lqzt,checkstatus",resBody = "id,bmxxmc,njdm,xm,xb,sfzlx,sfzjh,csrq,hksf,hkqx,ryyj,zfxz,djlx,lqzt,checkstatus")
    public JSONObject queryXXDJXSList(HttpServletRequest request, HttpServletResponse response) {
        // TODO:  登记学生录取列表M7-11
        Map<String, Object> map = ResponseUtils.createRequestAndSessionLoginInfo(request);
        map.remove("schoolcode");
        map.remove("districtcode");
        JSONObject rs = null;
        try {
            rs = admissionService.queryXXDJXSList(map);
        } catch (Exception e) {
            e.printStackTrace();
            return ResponseUtils.createErrorResponseBody(e.getMessage());
        }
        return rs;
    }

    /**
     * 导出登记学生录取列表M7-112
     *
     * @param {id,limit:10,offset:0,order:"",sort:"",xm,sfzjh,sfzlx,njdm,ryyj,hksf,hkqx,djlx,lqzt,checkstatus,hksfscope,hkqxscope,ids}
     * @return [{id,bmxxmc,njdm,xm,xb,sfzlx,sfzjh,csrq,hksf,hkqx,ryyj,zfxz,djlx,lqzt,checkstatus}]
     * by huamin
     */
    @RequestMapping(value = "/expQueryXXDJXSList", method = RequestMethod.POST)
    @ResponseBody
    @AuthorityDeclaration(id = "M7-112", desc = "导出登记学生录取列表",reqParam = "limit,offset,order,sort,xm,sfzjh,sfzlx,njdm,ryyj,hksf,hkqx,djlx,lqzt,checkstatus",resBody = "id,bmxxmc,njdm,xm,xb,sfzlx,sfzjh,csrq,hksf,hkqx,ryyj,zfxz,djlx,lqzt,checkstatus")
    public JSONObject expQueryXXDJXSList(HttpServletRequest request, HttpServletResponse response) {
        // TODO:  导出登记学生录取列表M7-112
        Map<String,Object> map = ResponseUtils.createRequestAndSessionLoginInfo(request);
        map.remove("schoolcode");
        map.remove("districtcode");
        JSONObject rs = ResponseUtils.createErrorResponseBody(null);
        HttpSession session = request.getSession();
        LoginInfo loginInfo = (LoginInfo) session.getAttribute("userinfo");
        try {
            if(loginInfo == null) throw new SystemTimeOutException();
            rs = admissionService.expQueryXXDJXSList(map);
        } catch (Exception e) {
            e.printStackTrace();
            return ResponseUtils.createErrorResponseBody(e.getMessage());
        }
        return rs;
    }

    /**
     * 录取学生名单列表M7-12
     *
     * @param {limit:10,offset:0,order:"",sort:"",xm,sfzjh,sfzlx,njdm,ryyj,hksf,hkqx,djlx,lqzt,checkstatus,hksfscope,hkqxscope}
     * @return [{id,lqxxmc,njdm,xm,xb,sfzlx,sfzjh,csrq,hksf,hkqx,ryyj,zfxz,djlx,lqzt,checkstatus}]
     * by huamin
     */
    @RequestMapping(value = "/queryXXLuquList", method = RequestMethod.POST)
    @ResponseBody
    @AuthorityDeclaration(id = "M7-12", desc = "录取学生名单列表",reqParam = "limit,offset,order,sort,xm,sfzjh,sfzlx,njdm,ryyj,hksf,hkqx,djlx,lqzt,checkstatus",resBody = "id,njdm,xm,xb,sfzlx,sfzjh,csrq,hksf,hkqx,ryyj,zfxz,djlx,lqzt,checkstatus")
    public JSONObject queryXXLuquList(HttpServletRequest request, HttpServletResponse response) {
        // TODO:  M7-12录取学生名单列表
        Map<String, Object> map = ResponseUtils.createRequestAndSessionLoginInfo(request);
        map.remove("schoolcode");
        map.remove("districtcode");
        JSONObject rs = null;
        try {
            rs = admissionService.queryXXLuquList(map);
        } catch (Exception e) {
            e.printStackTrace();
            return ResponseUtils.createErrorResponseBody(e.getMessage());
        }
        return rs;
    }

    /**
     * 导出录取学生名单列表M7-122
     *
     * @param {id,limit:10,offset:0,order:"",sort:"",xm,sfzjh,sfzlx,njdm,ryyj,hksf,hkqx,djlx,lqzt,checkstatus,hksfscope,hkqxscope}
     * @return [{id,lqxxmc,njdm,xm,xb,sfzlx,sfzjh,csrq,hksf,hkqx,ryyj,zfxz,djlx,lqzt,checkstatus}]
     * by huamin
     */
    @RequestMapping(value = "/expQueryXXLuquList", method = RequestMethod.POST)
    @ResponseBody
    @AuthorityDeclaration(id = "M7-122", desc = "导出录取学生名单列表",reqParam = "limit,offset,order,sort,xm,sfzjh,sfzlx,njdm,ryyj,hksf,hkqx,djlx,lqzt,checkstatus",resBody = "id,njdm,xm,xb,sfzlx,sfzjh,csrq,hksf,hkqx,ryyj,zfxz,djlx,lqzt,checkstatus")
    public JSONObject expQueryXXLuquList(HttpServletRequest request, HttpServletResponse response) {
        // TODO:  导出录取学生名单列表M7-122
        Map<String,Object> map = ResponseUtils.createRequestAndSessionLoginInfo(request);
        map.remove("schoolcode");
        map.remove("districtcode");
        JSONObject rs = ResponseUtils.createErrorResponseBody(null);
        HttpSession session = request.getSession();
        LoginInfo loginInfo = (LoginInfo) session.getAttribute("userinfo");
        try {
            if(loginInfo == null) throw new SystemTimeOutException();
            rs = admissionService.expQueryXXLuquList(map);
        } catch (Exception e) {
            e.printStackTrace();
            return ResponseUtils.createErrorResponseBody(e.getMessage());
        }
        return rs;
    }

    /**
     * 区县录取学生名单列表M7-13
     *
     * @param {limit:10,offset:0,order:"",sort:"",xm,sfzjh,sfzlx,njdm,ryyj,hksf,hkqx,djlx,lqzt,checkstatus,hksfscope,hkqxscope,djxx}
     * @return [{id,djxxmc,lqxxmc,njdm,xm,xb,sfzlx,sfzjh,csrq,hksf,hkqx,ryyj,zfxz,djlx,lqzt,checkstatus}]
     * by huamin
     */
    @RequestMapping(value = "/queryQXLuquList", method = RequestMethod.POST)
    @ResponseBody
    @AuthorityDeclaration(id = "M7-13", desc = "录取学生名单列表",reqParam = "limit,offset,order,sort,xm,sfzjh,sfzlx,njdm,ryyj,hksf,hkqx,djlx,lqzt,checkstatus",resBody = "id,njdm,xm,xb,sfzlx,sfzjh,csrq,hksf,hkqx,ryyj,zfxz,djlx,lqzt,checkstatus")
    public JSONObject queryQXLuquList(HttpServletRequest request, HttpServletResponse response) {
        // TODO:  区县录取学生名单列表M7-13
        Map<String, Object> map = ResponseUtils.createRequestAndSessionLoginInfo(request);
        JSONObject rs = null;
        try {
            rs = admissionService.queryQXLuquList(map);
        } catch (Exception e) {
            e.printStackTrace();
            return ResponseUtils.createErrorResponseBody(e.getMessage());
        }
        return rs;
    }

    /**
     * 导出区县录取学生名单列表M7-132
     *
     * @param {id,limit:10,offset:0,order:"",sort:"",xm,sfzjh,sfzlx,njdm,ryyj,hksf,hkqx,djlx,lqzt,checkstatus,hksfscope,hkqxscope}
     * @return [{id,djxxmc,lqxxmc,njdm,xm,xb,sfzlx,sfzjh,csrq,hksf,hkqx,ryyj,zfxz,djlx,lqzt,checkstatus}]
     * by huamin
     */
    @RequestMapping(value = "/expQueryQXLuquList", method = RequestMethod.POST)
    @ResponseBody
    @AuthorityDeclaration(id = "M7-132", desc = "导出区县录取学生名单列表",reqParam = "limit,offset,order,sort,xm,sfzjh,sfzlx,njdm,ryyj,hksf,hkqx,djlx,lqzt,checkstatus",resBody = "id,njdm,xm,xb,sfzlx,sfzjh,csrq,hksf,hkqx,ryyj,zfxz,djlx,lqzt,checkstatus")
    public JSONObject expQueryQXLuquList(HttpServletRequest request, HttpServletResponse response) {
        // TODO:  导出区县录取学生名单列表M7-132
        Map<String,Object> map = ResponseUtils.createRequestAndSessionLoginInfo(request);
        JSONObject rs = ResponseUtils.createErrorResponseBody(null);
        HttpSession session = request.getSession();
        LoginInfo loginInfo = (LoginInfo) session.getAttribute("userinfo");
        try {
            if(loginInfo == null) throw new SystemTimeOutException();
            rs = admissionService.expQueryQXLuquList(map);
        } catch (Exception e) {
            e.printStackTrace();
            return ResponseUtils.createErrorResponseBody(e.getMessage());
        }
        return rs;
    }

    /**
     * 录取-查看录取信息M7-20
     *
     * @param {id}
     * @return [djinfo:{ id,xm,xb,sfzlx,sfzjh,djxx,djsj,djlx,lqxx,lqzt,djxxmc,lqxxmc,lqsj},bminfo:[{bmxx},{bmsj}]]
     * by huamin
     */
    @RequestMapping(value = "/queryluquListById", method = RequestMethod.POST)
    @ResponseBody
    @AuthorityDeclaration(id = "M7-20", desc = "录取-查看录取信息",reqParam = "id",resBody = "djinfo:{ id,xm,xb,sfzlx,sfzjh,djxx,djsj,djlx,lqxx,lqzt,djxxmc,lqxxmc,lqsj},bminfo:[{bmxx},{bmsj}]")
    public JSONObject queryluquListById(HttpServletRequest request, HttpServletResponse response) {
        // TODO:  录取-查看录取信息M7-20
        Map<String, Object> map = ResponseUtils.createRequestAndSessionLoginInfo(request);
        JSONObject rs = null;
        try {
            rs = admissionService.queryluquListById(map);
        } catch (Exception e) {
            e.printStackTrace();
            return ResponseUtils.createErrorResponseBody(e.getMessage());
        }
        return rs;
    }

    /**
     * 录取M7-21
     * @param {id}
     * @return{}
     *  by huamin
     */
    @RequestMapping(value = "/setLuquById", method = RequestMethod.POST)
    @ResponseBody
    @AuthorityDeclaration(id = "M7-21", desc = "录取",reqParam = "id",resBody = "成功")
    public JSONObject setLuquById(HttpServletRequest request, HttpServletResponse response) {
        // TODO:  录取M7-21
        Map<String, Object> map = ResponseUtils.createRequestAndSessionLoginInfo(request);
        map.put("lqzt","1");//lqzt(1录取)
        JSONObject rs = null;
        try {
            rs = admissionService.setLuquById(map);
        } catch (Exception e) {
            e.printStackTrace();
            return ResponseUtils.createErrorResponseBody(e.getMessage());
        }
        return rs;
    }

    /**
     * 取消录取M7-22
     * @param {id}
     * @return{}
     *  by huamin
     */
    @RequestMapping(value = "/cancelLuquById", method = RequestMethod.POST)
    @ResponseBody
    @AuthorityDeclaration(id = "M7-22", desc = "取消录取",reqParam = "id",resBody = "成功")
    public JSONObject cancelLuquById(HttpServletRequest request, HttpServletResponse response) {
        // TODO:  取消录取M7-22
        Map<String, Object> map = ResponseUtils.createRequestAndSessionLoginInfo(request);
        map.put("lqzt","0");//lqzt(0取消录取)
        JSONObject rs = null;
        try {
            rs = admissionService.cancelLuquById(map);
        } catch (Exception e) {
            e.printStackTrace();
            return ResponseUtils.createErrorResponseBody(e.getMessage());
        }
        return rs;
    }
    /**
     * 设置待统筹M7-23
     * @param {id}
     * @return{}
     *  by huamin
     */
    @RequestMapping(value = "/setDaitongchouById", method = RequestMethod.POST)
    @ResponseBody
    @AuthorityDeclaration(id = "M7-23", desc = "设置待统筹",reqParam = "id",resBody = "成功")
    public JSONObject setDaitongchouById(HttpServletRequest request, HttpServletResponse response) {
        // TODO:  设置待统筹M7-23
        Map<String, Object> map = ResponseUtils.createRequestAndSessionLoginInfo(request);
        map.put("lqzt","2");//lqzt(2设置待统筹)
        JSONObject rs = null;
        try {
            rs = admissionService.setDaitongchouById(map);
        } catch (Exception e) {
            e.printStackTrace();
            return ResponseUtils.createErrorResponseBody(e.getMessage());
        }
        return rs;
    }
    /**
     * 取消待统筹M7-24
     * @param {id}
     * @return{}
     *  by huamin
     */
    @RequestMapping(value = "/cancelDaitongchouById", method = RequestMethod.POST)
    @ResponseBody
    @AuthorityDeclaration(id = "M7-24", desc = "取消待统筹",reqParam = "id",resBody = "成功")
    public JSONObject cancelDaitongchouById(HttpServletRequest request, HttpServletResponse response) {
        // TODO:  取消待统筹M7-24
        Map<String, Object> map = ResponseUtils.createRequestAndSessionLoginInfo(request);
        map.put("lqzt","0");//lqzt(0取消待统筹)
        JSONObject rs = null;
        try {
            rs = admissionService.cancelDaitongchouById(map);
        } catch (Exception e) {
            e.printStackTrace();
            return ResponseUtils.createErrorResponseBody(e.getMessage());
        }
        return rs;
    }

    /**
     * 统筹录取学校列表M7-251
     * @param {id}
     * @return{lqxx,lqxxmc}
     *  by huamin
     */
    @RequestMapping(value = "/getTongchouLuquSchoolList", method = RequestMethod.POST)
    @ResponseBody
    @AuthorityDeclaration(id = "M7-251", desc = "统筹录取学校列表",reqParam = "id",resBody = "lqxx,lqxxmc")
    public JSONObject getTongchouLuquSchoolList(HttpServletRequest request, HttpServletResponse response) {
        // TODO:  统筹录取学校列表M7-251
        Map<String, Object> map = ResponseUtils.createRequestAndSessionLoginInfo(request);
        JSONObject rs = null;
        try {
            rs = admissionService.getTongchouLuquSchoolList(map);
        } catch (Exception e) {
            e.printStackTrace();
            return ResponseUtils.createErrorResponseBody(e.getMessage());
        }
        return rs;
    }

    /**
     * 设置统筹录取M7-25
     * @param {id,lqxx}
     * @return{}
     *  by huamin
     */
    @RequestMapping(value = "/setTongchouLuquById", method = RequestMethod.POST)
    @ResponseBody
    @AuthorityDeclaration(id = "M7-25", desc = "设置统筹录取",reqParam = "id,lqxx",resBody = "成功")
    public JSONObject setTongchouLuquById(HttpServletRequest request, HttpServletResponse response) {
        // TODO:  设置统筹录取M7-25
        Map<String, Object> map = ResponseUtils.createRequestAndSessionLoginInfo(request);
        map.put("lqzt","3");//lqzt(3统筹录取)
        JSONObject rs = null;
        try {
            rs = admissionService.setTongchouLuquById(map);
        } catch (Exception e) {
            e.printStackTrace();
            return ResponseUtils.createErrorResponseBody(e.getMessage());
        }
        return rs;
    }

    /**
     * 取消统筹录取M7-26
     * @param {id}
     * @return{}
     *  by huamin
     */
    @RequestMapping(value = "/cancelTongchouLuquById", method = RequestMethod.POST)
    @ResponseBody
    @AuthorityDeclaration(id = "M7-26", desc = "取消统筹录取",reqParam = "id",resBody = "成功")
    public JSONObject cancelTongchouLuquById(HttpServletRequest request, HttpServletResponse response) {
        // TODO:  取消待统筹M7-26
        Map<String, Object> map = ResponseUtils.createRequestAndSessionLoginInfo(request);
        map.put("lqzt","2");//lqzt(2取消统筹录取)
        JSONObject rs = null;
        try {
            rs = admissionService.cancelTongchouLuquById(map);
        } catch (Exception e) {
            e.printStackTrace();
            return ResponseUtils.createErrorResponseBody(e.getMessage());
        }
        return rs;
    }

    /**
     * 批量录取M7-31
     * @param {}
     * @return{}
     *  by huamin
     */
    @RequestMapping(value = "/setLuquByIdList", method = RequestMethod.POST)
    @ResponseBody
    @AuthorityDeclaration(id = "M7-31", desc = "批量录取",reqParam = "",resBody = "成功")
    public JSONObject setLuquByIdList(@RequestParam(value = "upfile_attachment", required = false) MultipartFile file, HttpServletRequest request, HttpServletResponse response) throws IOException, DictIsNotFoundException {
        // TODO:  批量录取M7-31
            Map<String,Object> params = new DataMap<>();
            params.put("lqzt","1");//lqzt(1录取)
            JSONObject rs = ResponseUtils.createErrorResponseBody(null);
            HttpSession session = request.getSession();
            LoginInfo loginInfo = (LoginInfo) session.getAttribute("userinfo");
            params.put("file",file);
            try {
                if(loginInfo == null)throw new SystemTimeOutException();
                    rs = admissionService.setLuquByIdList(params,loginInfo);
            } catch (Exception e) {
                e.printStackTrace();
                return ResponseUtils.createErrorResponseBody(e.getMessage());
            }
        return rs;
        }

    /**
     * 批量设置待统筹M7-32
     * @param {}
     * @return{}
     *  by huamin
     */
    @RequestMapping(value = "/setDaitongchouByIdList", method = RequestMethod.POST)
    @ResponseBody
    @AuthorityDeclaration(id = "M7-32", desc = "批量设置待统筹",reqParam = "",resBody = "成功")
    public JSONObject setDaitongchouByIdList(@RequestParam(value = "upfile_attachment", required = false) MultipartFile file, HttpServletRequest request, HttpServletResponse response) throws IOException, DictIsNotFoundException {
        // TODO:  批量设置待统筹M7-32
        Map<String,Object> params = new DataMap<>();
        params.put("lqzt","2");//lqzt(2设置待统筹)
        JSONObject rs = ResponseUtils.createErrorResponseBody(null);
        HttpSession session = request.getSession();
        LoginInfo loginInfo = (LoginInfo) session.getAttribute("userinfo");
        params.put("file",file);
        try {
            if(loginInfo == null)throw new SystemTimeOutException();
            rs = admissionService.setDaitongchouByIdList(params,loginInfo);
        } catch (Exception e) {
            e.printStackTrace();
            return ResponseUtils.createErrorResponseBody(e.getMessage());
        }
        return rs;
    }

    /**
     * 批量统筹录取M7-33
     * @param {}
     * @return{}
     *  by huamin
     */
    @RequestMapping(value = "/setTongchouLuquByIdList", method = RequestMethod.POST)
    @ResponseBody
    @AuthorityDeclaration(id = "M7-33", desc = "批量统筹录取",reqParam = "",resBody = "成功")
    public JSONObject setTongchouLuquByIdList(@RequestParam(value = "upfile_attachment", required = false) MultipartFile file, HttpServletRequest request, HttpServletResponse response) throws IOException, DictIsNotFoundException {
        // TODO:  批量统筹录取M7-33
        Map<String,Object> params = new DataMap<>();
        params.put("lqzt","3");//lqzt(3统筹录取)
        JSONObject rs = ResponseUtils.createErrorResponseBody(null);
        HttpSession session = request.getSession();
        LoginInfo loginInfo = (LoginInfo) session.getAttribute("userinfo");
        params.put("file",file);
        try {
            if(loginInfo == null)throw new SystemTimeOutException();
            rs = admissionService.setTongchouLuquByIdList(params,loginInfo);
        } catch (Exception e) {
            e.printStackTrace();
            return ResponseUtils.createErrorResponseBody(e.getMessage());
        }
        return rs;
    }

    /**
     * 生成待统筹学生上报表M7-4
     *
     * @param {}
     * @return []
     * by huamin
     */
    @RequestMapping(value = "/expDaiTongchouSbReport", method = RequestMethod.POST)
    @ResponseBody
    @AuthorityDeclaration(id = "M7-4", desc = "生成待统筹学生上报表",reqParam = "",resBody = "")
    public JSONObject expDaiTongchouSbReport(HttpServletRequest request, HttpServletResponse response) {
        // TODO:  生成待统筹学生上报表M7-4
        Map<String,Object> map = ResponseUtils.createRequestAndSessionLoginInfo(request);
        map.remove("schoolcode");
        map.remove("districtcode");
        JSONObject rs = ResponseUtils.createErrorResponseBody(null);
        HttpSession session = request.getSession();
        LoginInfo loginInfo = (LoginInfo) session.getAttribute("userinfo");
        try {
            if(loginInfo == null) throw new SystemTimeOutException();
            rs = admissionService.expDaiTongchouSbReport(map,loginInfo);
        } catch (Exception e) {
            e.printStackTrace();
            return ResponseUtils.createErrorResponseBody(e.getMessage());
        }
        return rs;
    }

    /**
     * 生成单个录取通知书M7-51
     *
     * @param {id}
     * @return []
     * by huamin
     */
    @RequestMapping(value = "/expluquNoticeById", method = RequestMethod.POST)
    @ResponseBody
    @AuthorityDeclaration(id = "M7-51", desc = "生成单个录取通知书",reqParam = "id",resBody = "")
    public JSONObject expluquNoticeById(HttpServletRequest request, HttpServletResponse response) {
        Map<String, Object> params = ResponseUtils.createRequestAndSessionLoginInfo(request);
        params.remove("schoolcode");
        params.remove("districtcode");
        JSONObject rs;
        try {
            rs = admissionService.expluquNoticeById(params);
        } catch (Exception e) {
            e.printStackTrace();
            return ResponseUtils.createErrorResponseBody(e.getMessage());
        }
        return rs;
    }

    /**
     * 生成全部录取通知书M7-52
     *
     * @param {}
     * @return []
     * by huamin
     */
    @RequestMapping(value = "/expluquNoticeAll", method = RequestMethod.POST)
    @ResponseBody
    @AuthorityDeclaration(id = "M7-52", desc = "生成全部录取通知书",reqParam = "",resBody = "")
    public JSONObject expluquNoticeAll(HttpServletRequest request, HttpServletResponse response) {
        Map<String, Object> params = ResponseUtils.createRequestAndSessionLoginInfo(request);
        params.remove("schoolcode");
        params.remove("districtcode");
        JSONObject rs;
        try {
            rs = admissionService.expluquNoticeAll(params);
        } catch (Exception e) {
            e.printStackTrace();
            return ResponseUtils.createErrorResponseBody(e.getMessage());
        }
        return rs;
    }
}
